package com.chinaunicom.service;

import com.chinaunicom.entity.ResponseResult;
import com.chinaunicom.service.impl.TestFallbackServiceImpl;
import com.myrule.MySelfRule;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author: ruiyanglee
 * @date: 2020-11-05 11:17
 * @description:
 */

@Component
@FeignClient(value = "spring-cloud-gateway", configuration = MySelfRule.class, fallback = TestFallbackServiceImpl.class)
public interface TestService {

    // 请求方式和 pay-service 提供的接口保持一致
    @RequestMapping(value = "/pay/msg", method = RequestMethod.GET)
    ResponseResult getMsg();

    @RequestMapping(value = "/pay/port", method = RequestMethod.GET)
    ResponseResult getPort();

    @RequestMapping(value = "/pay/circuitBreak/{id}", method = RequestMethod.GET)
    ResponseResult paymentCircuitBreaker(@PathVariable("id") Integer id);
}
